package a.i;

import java.awt.*;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.beans.Beans;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class ib
  implements jb
{
  private static ib a;
  private Map b = new HashMap();
  static Class c;
  static Class d;
  static Class e;
  static Class f;
  static Class g;
  static Class h;
  static Class i;
  static Class j;
  static Class k;
  static Class l;
  static Class m;
  static Class n;
  static Class o;
  static Class p;
  static Class q;
  static Class r;
  static Class s;
  public static int t;
  
  public void a()
  {
    a = this;
  }
  
  protected void b()
  {
    a(c == null ? (ib.c = a("java.lang.Integer")) : c, new c(c == null ? (ib.c = a("java.lang.Integer")) : c, c == null ? (ib.c = a("java.lang.Integer")) : c));
    a(d == null ? (ib.d = a("java.lang.Float")) : d, new c(d == null ? (ib.d = a("java.lang.Float")) : d, d == null ? (ib.d = a("java.lang.Float")) : d));
    a(e == null ? (ib.e = a("java.lang.Double")) : e, new c(e == null ? (ib.e = a("java.lang.Double")) : e, e == null ? (ib.e = a("java.lang.Double")) : e));
    a(f == null ? (ib.f = a("java.lang.Byte")) : f, new c(f == null ? (ib.f = a("java.lang.Byte")) : f, f == null ? (ib.f = a("java.lang.Byte")) : f));
    a(g == null ? (ib.g = a("java.lang.Short")) : g, new c(g == null ? (ib.g = a("java.lang.Short")) : g, g == null ? (ib.g = a("java.lang.Short")) : g));
    a(h == null ? (ib.h = a("java.lang.Boolean")) : h, new c(h == null ? (ib.h = a("java.lang.Boolean")) : h, h == null ? (ib.h = a("java.lang.Boolean")) : h));
    a(i == null ? (ib.i = a("java.lang.Long")) : i, new c(i == null ? (ib.i = a("java.lang.Long")) : i, i == null ? (ib.i = a("java.lang.Long")) : i));
    a(Integer.TYPE, new c(c == null ? (ib.c = a("java.lang.Integer")) : c, Integer.TYPE));
    a(Float.TYPE, new c(d == null ? (ib.d = a("java.lang.Float")) : d, Float.TYPE));
    a(Double.TYPE, new c(e == null ? (ib.e = a("java.lang.Double")) : e, Double.TYPE));
    a(Byte.TYPE, new c(f == null ? (ib.f = a("java.lang.Byte")) : f, Byte.TYPE));
    a(Short.TYPE, new c(g == null ? (ib.g = a("java.lang.Short")) : g, Short.TYPE));
    a(Boolean.TYPE, new c(h == null ? (ib.h = a("java.lang.Boolean")) : h, Boolean.TYPE));
    a(Long.TYPE, new c(i == null ? (ib.i = a("java.lang.Long")) : i, Long.TYPE));
    a(j == null ? (ib.j = a("java.lang.String")) : j, new e_());
    a(k == null ? (ib.k = a("java.awt.Color")) : k, new c_());
    a(l == null ? (ib.l = a("java.io.File")) : l, new c(l == null ? (ib.l = a("java.io.File")) : l));
    a(m == null ? (ib.m = a("java.util.Date")) : m, new c(m == null ? (ib.m = a("java.util.Date")) : m));
    a(n == null ? (ib.n = a("java.awt.Font")) : n, new h_());
    a(o == null ? (ib.o = a("java.net.URL")) : o, new a_());
    a(p == null ? (ib.p = a("java.awt.geom.Rectangle2D")) : p, new i_());
    a(q == null ? (ib.q = a("java.awt.geom.Point2D")) : q, new d_());
    a(r == null ? (ib.r = a("java.lang.Class")) : r, new f_());
    a(s == null ? (ib.s = a("java.util.Locale")) : s, new g_());
  }
  
  public void a(Class paramClass, jb paramjb)
  {
    this.b.put(paramClass, paramjb);
  }
  
  public jb a(Class paramClass)
  {
    return (jb)this.b.remove(paramClass);
  }
  
  public static ib c()
  {
    return a;
  }
  
  public Object a(String paramString, Class paramClass)
    throws IllegalArgumentException
  {
    if (paramString == null) {
      return null;
    }
    jb localjb = b(paramClass);
    if (!p.b) {
      if (localjb == null) {
        throw new IllegalArgumentException("No suitable objectStringConverter found for " + paramString + " [" + paramClass + "]");
      }
    }
    return localjb.a(paramString, paramClass);
  }
  
  public String a(Object paramObject, Class paramClass)
    throws IllegalArgumentException
  {
    if (paramObject == null) {
      return null;
    }
    jb localjb = b(paramClass);
    if (!p.b) {
      if (localjb == null) {
        throw new IllegalArgumentException("No suitable objectStringConverter found for " + paramObject + " [" + paramClass + "]");
      }
    }
    return localjb.a(paramObject, paramClass);
  }
  
  public jb b(Class paramClass)
  {
    boolean bool = p.b;
    jb localjb = (jb)this.b.get(paramClass);
    if (!bool) {
      if (localjb == null)
      {
        Iterator localIterator = this.b.entrySet().iterator();
        while (localIterator.hasNext())
        {
          Map.Entry localEntry = (Map.Entry)localIterator.next();
          Class localClass = (Class)localEntry.getKey();
          if (localClass.isAssignableFrom(paramClass)) {
            return (jb)localEntry.getValue();
          }
        }
        return null;
      }
    }
    return localjb;
  }
  
  static Class a(String paramString)
  {
    try
    {
      return Class.forName(paramString);
    }
    catch (ClassNotFoundException localClassNotFoundException)
    {
      throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
    }
  }
  
  static
  {
    ib localib = new ib();
    localib.b();
    a = localib;
  }
  
  private static final class f_
    extends b
  {
    f_()
    {
      super();
    }
    
    protected Object a(String paramString)
      throws IllegalArgumentException
    {
      try
      {
        Class localClass = Class.forName(paramString, false, getClass().getClassLoader());
        return localClass;
      }
      catch (ClassNotFoundException localClassNotFoundException)
      {
        throw new IllegalArgumentException("Did not find class " + paramString);
      }
      catch (Exception localException)
      {
        throw new IllegalArgumentException("Could not load class" + paramString);
      }
    }
    
    protected String a(Object paramObject)
    {
      return ((Class)paramObject).getName();
    }
  }
  
  private static final class a_
    extends b
  {
    a_()
    {
      super();
    }
    
    protected Object a(String paramString)
      throws IllegalArgumentException
    {
      boolean bool = p.b;
      try
      {
        if (!bool) {
          if (paramString.indexOf(":/") < 0) {
            return new File(paramString).toURL();
          }
        }
        if ((bool) || (paramString.startsWith("resource://")))
        {
          String str1 = paramString.substring("resource://".length());
          String str2 = null;
          String str3 = null;
          int i = str1.indexOf('#');
          if (i > 0)
          {
            str3 = str1.substring(i);
            str1 = str1.substring(0, i);
          }
          int j = str1.indexOf('?');
          if (j > 0)
          {
            str2 = str1.substring(j);
            str1 = str1.substring(0, j);
          }
          URL localURL = getClass().getClassLoader().getResource(str1);
          if (!bool) {
            if (localURL != null)
            {
              if (bool) {
                break label169;
              }
              if (str3 != null) {
                break label162;
              }
              if (bool) {
                break label169;
              }
              if (str2 != null) {
                break label162;
              }
            }
          }
          return localURL;
          label162:
          paramString = localURL.toString();
          label169:
          if (!bool) {
            if (str2 != null) {
              paramString = paramString + str2;
            }
          }
          if ((bool) || (str3 != null)) {
            paramString = paramString + str3;
          }
        }
        return new URL(paramString);
      }
      catch (MalformedURLException localMalformedURLException)
      {
        throw new IllegalArgumentException("Could not convert URL from " + paramString);
      }
    }
    
    protected String a(Object paramObject)
    {
      return ((URL)paramObject).toString();
    }
  }
  
  private static final class g_
    extends b
  {
    g_()
    {
      super();
    }
    
    protected Object a(String paramString)
      throws IllegalArgumentException
    {
      boolean bool2 = p.b;
      boolean bool1 = p.a;
      StringTokenizer localStringTokenizer = new StringTokenizer(paramString, "_", false);
      String str1 = localStringTokenizer.nextToken();
      if ((bool2) || (localStringTokenizer.hasMoreTokens()))
      {
        String str2 = localStringTokenizer.nextToken();
        if ((bool2) || (localStringTokenizer.hasMoreTokens()))
        {
          String str3 = localStringTokenizer.nextToken();
          localLocale = new Locale(str1, str2, str3);
          if (!bool2) {
            if (!bool1) {
              return localLocale;
            }
          }
        }
        else
        {
          if (bool2) {
            break label121;
          }
          localLocale = new Locale(str1, str2);
        }
        if (!bool1) {
          return localLocale;
        }
      }
      label121:
      Locale localLocale = new Locale(str1, "");
      return localLocale;
    }
    
    protected String a(Object paramObject)
    {
      boolean bool = p.b;
      Locale localLocale = (Locale)paramObject;
      String str = localLocale.getLanguage();
      if (!bool) {
        if (localLocale.getCountry().length() > 0)
        {
          str = str + "_" + localLocale.getCountry();
          if (bool) {
            break label100;
          }
          if (localLocale.getVariant().length() > 0) {
            str = str + "_" + localLocale.getVariant();
          }
        }
      }
      label100:
      return str;
    }
  }
  
  private static final class d_
    extends b
  {
    d_()
    {
      super();
    }
    
    protected Object a(String paramString)
      throws IllegalArgumentException
    {
      StringTokenizer localStringTokenizer = new StringTokenizer(paramString, "(,)", false);
      try
      {
        String str = localStringTokenizer.nextToken();
        Point2D localPoint2D = (Point2D)Beans.instantiate(getClass().getClassLoader(), str);
        double d1 = Double.parseDouble(localStringTokenizer.nextToken());
        double d2 = Double.parseDouble(localStringTokenizer.nextToken());
        localPoint2D.setLocation(d1, d2);
        return localPoint2D;
      }
      catch (NumberFormatException localNumberFormatException)
      {
        throw new IllegalArgumentException("Could not parse number " + paramString);
      }
      catch (ClassNotFoundException localClassNotFoundException)
      {
        throw new IllegalArgumentException("Unknown class " + localClassNotFoundException);
      }
      catch (IOException localIOException)
      {
        throw new IllegalArgumentException("Could not load class " + localIOException);
      }
    }
    
    protected String a(Object paramObject)
      throws IllegalArgumentException
    {
      Point2D localPoint2D = (Point2D)paramObject;
      StringBuffer localStringBuffer = new StringBuffer(50);
      localStringBuffer.append(localPoint2D.getClass().getName());
      localStringBuffer.append('(');
      localStringBuffer.append(localPoint2D.getX());
      localStringBuffer.append(',');
      localStringBuffer.append(localPoint2D.getY());
      localStringBuffer.append(')');
      return localStringBuffer.toString();
    }
  }
  
  private static final class i_
    extends b
  {
    i_()
    {
      super();
    }
    
    protected Object a(String paramString)
      throws IllegalArgumentException
    {
      StringTokenizer localStringTokenizer = new StringTokenizer(paramString, "(,)", false);
      try
      {
        String str = localStringTokenizer.nextToken();
        Rectangle2D localRectangle2D = (Rectangle2D)Beans.instantiate(getClass().getClassLoader(), str);
        double d1 = Double.parseDouble(localStringTokenizer.nextToken());
        double d2 = Double.parseDouble(localStringTokenizer.nextToken());
        double d3 = Double.parseDouble(localStringTokenizer.nextToken());
        double d4 = Double.parseDouble(localStringTokenizer.nextToken());
        localRectangle2D.setFrame(d1, d2, d3, d4);
        return localRectangle2D;
      }
      catch (NumberFormatException localNumberFormatException)
      {
        throw new IllegalArgumentException("Could not parse number " + paramString);
      }
      catch (ClassNotFoundException localClassNotFoundException)
      {
        throw new IllegalArgumentException("Unknown class " + localClassNotFoundException);
      }
      catch (IOException localIOException)
      {
        throw new IllegalArgumentException("Could not load class " + localIOException);
      }
    }
    
    protected String a(Object paramObject)
      throws IllegalArgumentException
    {
      Rectangle2D localRectangle2D = (Rectangle2D)paramObject;
      StringBuffer localStringBuffer = new StringBuffer(50);
      localStringBuffer.append(localRectangle2D.getClass().getName());
      localStringBuffer.append('(');
      localStringBuffer.append(localRectangle2D.getX());
      localStringBuffer.append(',');
      localStringBuffer.append(localRectangle2D.getY());
      localStringBuffer.append(',');
      localStringBuffer.append(localRectangle2D.getWidth());
      localStringBuffer.append(',');
      localStringBuffer.append(localRectangle2D.getHeight());
      localStringBuffer.append(')');
      return localStringBuffer.toString();
    }
  }
  
  private static final class h_
    extends b
  {
    h_()
    {
      super();
    }
    
    protected Object a(String paramString)
      throws IllegalArgumentException
    {
      return Font.decode(paramString);
    }
    
    protected String a(Object paramObject)
      throws IllegalArgumentException
    {
      boolean bool = p.b;
      Font localFont = (Font)paramObject;
      StringBuffer localStringBuffer = new StringBuffer(50);
      localStringBuffer.append(localFont.getFamily());
      localStringBuffer.append('-');
      if (!bool) {
        if (localFont.getStyle() == 0)
        {
          localStringBuffer.append("PLAIN");
          if (bool) {
            break label121;
          }
          if (!p.a) {
            break label105;
          }
        }
      }
      if (!bool) {
        if ((localFont.getStyle() & 0x1) == 1) {
          localStringBuffer.append("BOLD");
        }
      }
      if ((localFont.getStyle() & 0x2) == 2) {
        localStringBuffer.append("ITALIC");
      }
      label105:
      localStringBuffer.append('-');
      localStringBuffer.append(localFont.getSize());
      label121:
      return localStringBuffer.toString();
    }
  }
  
  private static final class b_
    extends b
  {
    private static DateFormat c = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    
    b_()
    {
      super();
    }
    
    protected Object a(String paramString)
      throws IllegalArgumentException
    {
      try
      {
        return c.parse(paramString);
      }
      catch (ParseException localParseException)
      {
        throw new IllegalArgumentException("Could not parse " + paramString + " " + localParseException);
      }
    }
    
    protected String a(Object paramObject)
      throws IllegalArgumentException
    {
      return c.format((Date)paramObject);
    }
  }
  
  private static final class c_
    extends b
  {
    c_()
    {
      super();
    }
    
    protected Object a(String paramString)
      throws IllegalArgumentException
    {
      return Color.decode("0x" + paramString.substring(1));
    }
    
    protected String a(Object paramObject)
      throws IllegalArgumentException
    {
      boolean bool = p.b;
      Color localColor = (Color)paramObject;
      StringBuffer localStringBuffer = new StringBuffer(7);
      localStringBuffer.append('#');
      String str = Integer.toHexString(localColor.getRed());
      if (!bool)
      {
        if (str.length() == 1) {
          localStringBuffer.append('0');
        }
        localStringBuffer.append(str);
        str = Integer.toHexString(localColor.getGreen());
      }
      if (!bool)
      {
        if (str.length() == 1) {
          localStringBuffer.append('0');
        }
        localStringBuffer.append(str);
        str = Integer.toHexString(localColor.getBlue());
        if (bool) {}
      }
      else
      {
        if (str.length() == 1) {
          localStringBuffer.append('0');
        }
        localStringBuffer.append(str);
      }
      return localStringBuffer.toString();
    }
  }
  
  private static final class e_
    extends b
  {
    e_()
    {
      super();
    }
    
    protected Object a(String paramString)
      throws IllegalArgumentException
    {
      return paramString;
    }
    
    protected String a(Object paramObject)
      throws IllegalArgumentException
    {
      return (String)paramObject;
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.i.ib

 * JD-Core Version:    0.7.0.1

 */